/**
 * Created by seeker910 on 2014/8/31.
 * @description 组件名称命名约定：继承container组件，名称以ViewPart结尾;继承control组件，名称以Part结尾
 * 浮动框
 */
Rsd.define('Rsd.hermit.sections.BlogItemViewPart', {
    extend: 'Rsd.container.Component',
    requires: [
        'Rsd.form.Label',
        'Rsd.form.Image',
        'Rsd.form.Button'
    ],
    xtype: 'blog-item-view',
     /**
     * @description 标识该组件是否允许编辑
     */
    domEditable: false,
    /**
     * @description true:表示只允许在模板中修改
     */
    editInMaster:false,
    height:350,
    layout: {type:'vbox',align:'center'}, 
    style:{
        borderRadius:'5px',
        border:'1px solid #808080e2', 
    },
    layout:{type:'vbox',align:'center'},
    items: [
        {
            xtype:'image',
            flex:1,
            label: null
        },
        {
            xtype:'label',
            margin:'0 0 0 0',
            width:'90%',
            height:30, 
            label:false,
            style:{ textAlign:'right'}, 
            text:'by admin Sep 24,2024'
        },
        {
            xtype:'label',
            width:'100%',
            height:70,
            mulitiLine:true,
            label:false,
            style:{ 
                lineHeight:25,
                fontWeight:'bold'
            }, 
            text:'It is a long established fact that a reader will.'
        },
        {
            xtype:'button', 
            margin:'0 4 15 0',
            height:45,
            width:140,
            handler:'btn_read_more',
            text:'READ MORE'
        }
    ],
    /*
     * */
    constructor: function FloatingBoxPart(config) {
        config = config || {};
        Rsd.apply(this, config);
    },
    /**
     * 
     */
    loadData:function loadData(data)
    {
        var _data = data||this.dataSource||{}; 
        this.dataSource = _data;
        this.items[0].setSrc(_data.image); 
        this.items[1].setText('by ' +  (_data.author||'xxx') + ' ' +(_data.time||'00-00-0000'));
        this.items[2].setText(_data.title);
    },
    btn_read_more:function()
    {
        Rsd.app.goto('blog','key=' + (this.dataSource.key||'')); 
 
    }
});
